package com.theme.passport.controller.app;

import com.theme.common.mvc.utils.PageUtils;
import com.theme.common.mvc.view.R;
import com.theme.passport.service.theme.AppIconService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


/**
 * 默认APP对应的ico列表
 *
 * @author live
 * @email 870459550@qq.com
 * @date 2020-11-27 16:45:44
 */
@RestController
@RequestMapping("app/icon")
@Api("获取app应用软件列表接口")
public class AppIconsController {

    @Autowired
    private AppIconService appIconService;

    @GetMapping("/list")
    @ApiOperation("获取应用软件列表")
    public R list(@RequestParam(value = "keyword", required = false) String keyword,
                  @RequestParam(value = "page", defaultValue = "1") String page,
                  @RequestParam(value = "limit", defaultValue = "10") String limit){
        Map<String, Object> params = new HashMap<>();
        params.put("key",keyword);
        params.put("page", page);
        params.put("limit", limit);
        PageUtils pages = appIconService.queryPage(params);
        return R.ok().put("page", pages);
    }

}
